package com.czy.config;

import com.czy.controller.ChatRoomServerEndpoint;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;


/**
 * 开启WebSocket支持
 * @Author: czy
 * @Date: 2019/10/31 16:33
 */
@Configuration
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter(){
        return new ServerEndpointExporter();
    }

    /**
     * 注册 端点对象
     */
    @Bean
    public ChatRoomServerEndpoint chatRoomServerEndpoint(){
        return new ChatRoomServerEndpoint();
    }
}
